<?php
/**
 * Created by PhpStorm.
 * User: Charles
 * Date: 2018-07-05
 * Time: 15:08
 */

namespace app\admin\model;

use think\Model;

class AuthRuleModel extends Model
{

    /**
     * 获取当前用户所有权限
     * @return array
     */
    public function adminAuthRule(){
        $result = $this->where(['type'=> 'admin_url', 'status' => 1])->select();
        $array = [];
        foreach ($result as $v) {
            if (cmf_auth_check(cmf_get_current_admin_id(), $v['name'])) {
                $array[] = $v;
            }
        }
        return $array;
    }

}